package net.shao.base;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Toast;

import net.shao.AShaoApplication;
import net.shao.utils.ActivitiesUtils;
import net.shao.utils.ToastUtils;

/**
 * Created by shao on 2016/6/29.
 */
public class BaseActivity extends Activity {

    public AShaoApplication shaoApplication;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivitiesUtils.addActivity(this);
        shaoApplication = AShaoApplication.getShaoApplicationInstance();
    }

    public void toActivity(Class clazz){
        Intent intent = new Intent(BaseActivity.this,clazz);
        startActivity(intent);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActivitiesUtils.removeActivity(this);
    }

    protected void showToast(String toast){
        ToastUtils.showToast(BaseActivity.this,toast);
    }

}
